<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.hfun.server.dao${readPackageName}.R${objectName}Mapper" >
    <resultMap id="BaseResultMap" type="com.hfun.server.domain${packageName}.${objectName}Model">
        <id column="id" property="id" />
    <#list columns as item>
        <result column="${item.column}" property="${item.property}" />
    </#list>
    </resultMap>

    <!-- 根据条件查询 -->
    <select id="selectByObejctPaging" parameterType="com.hfun.server.domain${packageName}.${objectName}Model" resultMap="BaseResultMap">
        select
        <include refid="RBase.Base_Column_Fields" />
        from ${tableTop}${tableName}
        <include refid="RBase.where"/>
        <include refid="RBase.query_condition_sql"/>
        <include refid="RBase.order_column_sql"/>
        <include refid="RBase.page_sql"/>
    </select>

    <select id="selectCountByObject" parameterType="com.hfun.server.domain${packageName}.${objectName}Model" resultType="java.lang.Integer">
        select count(*) from ${tableTop}${tableName}
        <include refid="RBase.where"/>
        <include refid="RBase.query_condition_sql"></include>
    </select>
</mapper>